import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralBizParam = (params) => {
  params.head.transCode = 'queryGeneralBizParam';
  return request({
    url: '/general/generalBizParam/queryGeneralBizParam',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralBizParamListPage = (params) => {
  params.head.transCode = 'queryGeneralBizParamListPage';
  return request({
    url: '/general/generalBizParam/queryGeneralBizParamListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralBizParam = (params) => {
  params.head.transCode = 'saveGeneralBizParam';
  return request({
    url: '/general/generalBizParam/saveGeneralBizParam',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralBizParamList = (params) => {
  params.head.transCode = 'saveGeneralBizParamList';
  return request({
    url: '/general/generalBizParam/saveGeneralBizParamList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralBizParam = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizParam';
  return request({
    url: '/general/generalBizParam/saveOrUpdateGeneralBizParam',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralBizParamList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralBizParamList';
  return request({
    url: '/general/generalBizParam/saveOrUpdateGeneralBizParamList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralBizParam = (params) => {
  params.head.transCode = 'updateGeneralBizParam';
  return request({
    url: '/general/generalBizParam/updateGeneralBizParam',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralBizParam = (params) => {
  params.head.transCode = 'deleteGeneralBizParam';
  return request({
    url: '/general/generalBizParam/deleteGeneralBizParam',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralBizParamList = (params) => {
  params.head.transCode = 'deleteGeneralBizParamList';
  return request({
    url: '/general/generalBizParam/deleteGeneralBizParamList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralBizParamExcel = (params) => {
  downloadExcel({
    url: '/general/generalBizParam/exportGeneralBizParamExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
